#!/bin/sh
#
# Board specific defaults
#------------------------------------------------------------------------------

#
# Bootloader upgrade
#
set BL_FILE /etc/extras/cubepilot_cubeorange_bootloader.bin
if [ -f $BL_FILE ]
then
	if param compare SYS_BL_UPDATE 1
	then
		param set SYS_BL_UPDATE 0
		param save
		echo "BL update..."
		bl_update $BL_FILE
		echo "BL update done"
		reboot
	fi
fi
unset BL_FILE


param set-default BAT_V_DIV 10.1
param set-default BAT1_V_DIV 10.1
param set-default BAT2_V_DIV 10.1

param set-default BAT_A_PER_V 17
param set-default BAT1_A_PER_V 17
param set-default BAT2_A_PER_V 17

# Multi-EKF
param set-default EKF2_MULTI_IMU 3
param set-default SENS_IMU_MODE 0
param set-default EKF2_MULTI_MAG 3
param set-default SENS_MAG_MODE 0

# Disable IMU thermal control
param set-default SENS_EN_THERMAL 0

param set-default UAVCAN_ENABLE 2


set LOGGER_BUF 64
set IOFW "/etc/extras/cubepilot_io-v2_default.bin"
